<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  //  继承
  // 内部的核心还是构造函数
  // class是语法糖
  class Parent {
    constructor(name) {
      console.log(this)
      // this
      this.name = '234'
    }

    sing() {
      console.log('父亲')
    }
  }

  class Child extends Parent {
    constructor() {
      // 调用父类构造函数的时候同时把父类构造函数内部的this指向当前constructor的this
      super();
    }

    sing() {
      //  调用父类的sing方法
      super.sing()
      console.log('儿子')
    }
  }

  const child = new Child()


  console.log(child.__proto__ === Child.prototype)
  console.log(child.sing())

  // Promise.all
  // Promise.race

  // Array.isArray()
  //
  // const arr = []
  // arr.forEach()


  //  什么是实例属性？什么是静态属性？
  //
</script>
</body>
</html>
